import axios from '../utils/http'

const IndexStore = {
    namespaced: true,
    state: () => ({
        index_list: []

    }),
    mutations: {
        IndexMutations(state, old) {
            state.index_list = old
        }
    },
    actions: {
        IndexActions(context) {
            axios.get("/getbanner").then(
                res => {
                    if(res.code == 403){
                        localStorage.removeItem('log_list')
                        window.location.href = "/#/login"
                       
                    }else{
                        context.commit("IndexMutations", res.list)
                    }
                }
            )
        }

    }
}
export default IndexStore